#include <iostream>
#include <list>
#include <queue>
using namespace std;

template<class ItemType>
class Graph {

	public:

		Graph();

		void AddNode(ItemType label);

		void DeleteNode(ItemType label);

		void AddEdge(ItemType label1, ItemType label2, int weight);

		void ChangeEdgeWeight(ItemType label1, ItemType label2, int weight);

		void DeleteEdge(ItemType label1, ItemType label2);

		list<ItemType> findPath(ItemType label1, ItemType label2);

		list<ItemType> Depth(ItemType label);

		list<ItemType> Breadth(ItemType label);

		void Print(ostream &out);

		bool isUndirected();

		list<ItemType> NodesWithinNEdges(ItemType label, int N);

		void findNetworkFlow(Graph<ItemType> &flow);

		
	private:

		int nnodes;					// number of nodes in the graph
		int maxsize;				// declared size of the arrays
		int noedge;					// value indicating that an edge doesn't exist
		ItemType labels[15];		// array of node labels
		int adj[15][15];			// 2-dimensional array of edge weights
									// to adjacent nodes

		int findLabel(ItemType label);
		void MarkVisited(int node, list<ItemType> &visited, ItemType find = "");
		bool BeenVisited(list<ItemType> visited, ItemType node);
		void WithinN(int node, list<ItemType> &visited, int nEdges);
};

#include "graph.cpp"